package common.hua.com.mycontrolactivity;


import android.annotation.SuppressLint;
import android.os.Bundle;
import android.widget.Toast;

import com.hua.common.BaseActivity;
import com.hua.common.commontools.DipUtil;
import com.hua.common.commonview.DragControl;

import common.hua.com.myapplication.R;

/**
 * 可拖动控件测试界面
 * @author huaxiaolin_pc
 *
 */
public class DragControlActivity extends BaseActivity {
	private DragControl control = null;


	@Override
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		this.setPageTitle("拖动");
		this.initViews();
	}

	private void initViews(){
		setContentViewItem(R.layout.dragactivity_layout);
		this.control = (DragControl) this.findViewById(R.id.control);
		this.control.setPhoneHeight(this.getWindowManager().getDefaultDisplay()
				.getHeight());
		this.control.setPhoneWidth(this.getWindowManager().getDefaultDisplay()
				.getWidth());
		this.control.setClickListenter(new DragControl.MyClicklistener() {
			@SuppressLint("ShowToast")
			@Override
			public void click() {
				Toast.makeText(DragControlActivity.this, "点击事件", Toast.LENGTH_LONG).show();
			}
		});

		this.control.setMyTop(DipUtil.Dp2px(this,48));
	}

}
